/**
 * Dart中我们也可以在构造函数体运行之前初始化实例变量
 */
class Rect {
  num height;
  num width;

  Rect() : height=2,width=10 { //实例化之前先赋值
    print("${this.height} --- ${this.width}");
  }

  getArea() {
    return this.height * this.width;
  }

}

void main() {
  Rect r = new Rect();
  print(r.getArea());
}